package mango.orm.entity.maker;

public final class PDM2Java {
    public static final void main(String[] args) {

        if (args.length < 3) {
            println("用法：");
            println("");
            println("    java PDM2Java PackageName DestPath PDMFilePath [TableName]");
            println("");
            println("其中：");
            println("    PackageName  生成Java类的包名");
            println("    DestPath     生成Java类的目标路径");
            println("    PDMFilePath  生成Java类所需PDM文件的路径");
            println("    TableName  需要生成Java类的表");
            println("");
            println("示例：");
            println("");
            println("    java PDM2Java river.beans D:/src D:/pdm/test.pdm");
            println("    java PDM2Java river.beans D:/src D:/pdm/test.pdm TableA,TableB");
            return;
        }
        try {
            if (args.length >= 4) {
                Maker.executePDM(args[0], args[1], args[2], args[3]);
            }
            else {
                Maker.executePDM(args[0], args[1], args[2], null);
            }
        }
        catch (Exception e) {
            e.printStackTrace();
        }
    }

    private final static void println(String str) {
        System.out.println(str);
    }
}
